package com.cloudcross.ssp.service;

import java.util.List;
import java.util.Map;

import com.cloudcross.ssp.model.AccountResources;
import com.cloudcross.ssp.model.Resources;
import com.cloudcross.ssp.base.service.BaseService;
import com.cloudcross.ssp.common.utils.Pager;

public interface IResourcesService extends BaseService<Resources> {
    // <!-- 根据账号Id获取该用户的权限-->
    List<Resources> findAccountResourcess(String accountId);

    /**
     * @return
     * @author wuqiang.du Email：mmm333zzz520@163.com date：2014-2-25
     */
    // 这个方法主要是为了直接通过账户查询对应的权限，和上面的那个方法的区别在于，这个方法是在res_account表中直接查询相应的

    List<Resources> findResourcesByAccount(Long id);

    List<Resources> findRoleRes(String roleId);

    boolean deleteResourceByAccount(Long accountId);

    List<Resources> queryByParentId(Resources resources);

    /**
     * 更新菜单排序号
     *
     * @param resourceVOs
     * @author wuqiang.du Email：mmm333zzz520@163.com date：2014-04-12
     */
    List<Resources> findAllResourcesByAccountId(Long id);

    void updateSortOrder(List<Resources> menus);

    void addRoleRes(String roleId, List<String> list);

    Resources isExist(String menuName);

    int getMaxLevel();

    // zj
    boolean deleteAccountNotinResources(Long accountId);

    boolean deleteAccountResourcess(Long accountId);

    boolean addAccountResourcess(Long accountId, List<Long> list);

    boolean addAccountNotinResourcess(Long accountId, List<Long> list);

    List<AccountResources> queryResourcesByAccountId(Long accountId);

    List<AccountResources> queryNotinResourcesById(Long accountId);

    List<Resources> findAllResources(Map<String, Object> condition, Pager pager);

    List<Resources> findAllResources();

    List<Resources> findResourcesById(long id);


    // 删除资源信息
    boolean deleteResource(Integer id);


    //获取所有目录
    List<Resources> findAllRootResources();

    //根据类型，父id获取资源
    List<Resources> findAllResourceById(Map<String, Object> paramMap);


}
